package com.shiwaixiangcun.monitor.domain;


import com.rabbit.spring.data.domain.BaseEntity;
import com.shiwaixiangcun.monitor.enums.WarningType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "ms_warning_content")
@DynamicUpdate
@DynamicInsert
public class WarningContent extends BaseEntity<Long> {

    @Enumerated(EnumType.STRING)
    private WarningType warningType;

    private String content;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "early_warning_id")
    private EarlyWarning earlyWarning;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date waringTime;

    private String waringAddress;

    public WarningContent() {
    }

    public String getWaringAddress() {
        return waringAddress;
    }

    public void setWaringAddress(String waringAddress) {
        this.waringAddress = waringAddress;
    }

    public Date getWaringTime() {
        return waringTime;
    }

    public void setWaringTime(Date waringTime) {
        this.waringTime = waringTime;
    }

    public EarlyWarning getEarlyWarning() {
        return earlyWarning;
    }

    public void setEarlyWarning(EarlyWarning earlyWarning) {
        this.earlyWarning = earlyWarning;
    }

    public WarningType getWarningType() {
        return warningType;
    }

    public void setWarningType(WarningType warningType) {
        this.warningType = warningType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
